package com.zjj.edu.system.domain;

import com.zjj.edu.common.core.domain.BaseEntity;
import lombok.Data;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

/**
 * 开班时间 sys_class_times
 *
 * @author zjj
 * @date 2020-08-4
 */
@Data
public class SysClassTimes extends BaseEntity implements Comparable<SysClassTimes>
{
    private static final long serialVersionUID = 1L;

    /** 编号 */
    private Long id;

    private Long classId;

    private String classDate;

    private String fullTime;

    private String beginTime1;

    private String beginTime2;

    private String endTime1;

    private String endTime2;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    private Long tenantId;

    private String[] ids;

    @Override
    public int compareTo(SysClassTimes o) {
        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        LocalDate parse1 = LocalDate.parse(this.getClassDate(), df);
        LocalDate parse2 = LocalDate.parse(o.getClassDate(), df);
        return parse1.compareTo(parse2);
    }
}
